aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/thread/[id]/+page.server.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-20 00:05:30 -0800
committerAdam Soltys <[email protected]>2025-01-20 00:05:33 -0800
commitc3f42df21c3a112f5639c06ca22801146667cc1e (patch)
treeb92bbbabe7eed8cde7b9d251cfcb08221689cc83 /src/routes/(app)/thread/[id]/+page.server.ts
parent8ff2f32290011c6ece95877a2ab36005578b91da (diff)
downloadcoinos-ui-c3f42df21c3a112f5639c06ca22801146667cc1e.tar.gz
coinos-ui-c3f42df21c3a112f5639c06ca22801146667cc1e.zip
nostr routes
Diffstat (limited to 'src/routes/(app)/thread/[id]/+page.server.ts')
-rw-r--r--src/routes/(app)/thread/[id]/+page.server.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/routes/(app)/thread/[id]/+page.server.ts b/src/routes/(app)/thread/[id]/+page.server.ts
new file mode 100644
index 00000000..931e9cb8
--- /dev/null
+++ b/src/routes/(app)/thread/[id]/+page.server.ts
@@ -0,0 +1,12 @@
+import { get } from "$lib/utils";
+import { error } from "@sveltejs/kit";
+
+export async function load({ params }) {
+ try {
+ const thread = await get(`/thread/${params.id}`);
+ return { thread };
+ } catch (e) {
+ console.log(e);
+ error(500, { message: "Failed to get thread" });
+ }
+}